package org.hibernate.onetomany.base;


import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;

public class BaseDao {
	
	@Autowired
	private SessionFactory sessionFactory;

	private Session session;
	
	public SessionFactory getSessionFactory() {
		return sessionFactory;
	}
	
	public Session getCurrentSession()
	{
		this.session = getSessionFactory().getCurrentSession();
		return this.session;
	}
	
}
